home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Registry.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  84 lines

  1. /*
  2.  * @(#)Registry.java    1.6 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.rmi.registry;
  15.  
  16. import java.rmi.*;
  17.  
  18. /**
  19.  * A "registry" exists on every node that allows RMI connections to
  20.  * servers on that node.  The registry on a particular node contains a
  21.  * transient database that maps names to remote objects.  When the
  22.  * node boots, the registry database is empty.  The names stored in the
  23.  * registry are pure and are not parsed.  A service storing itself in
  24.  * the registry may want to prefix its name of the service by a package
  25.  * name (although not required), to reduce name collisions in the
  26.  * registry.
  27.  *
  28.  * The LocateRegistry class is used to obtain the registry for different hosts.
  29.  *
  30.  * @see LocateRegistry
  31.  */
  32. public interface Registry extends Remote {
  33.     /** Well known port for registry */
  34.     public static final int REGISTRY_PORT = 1099;
  35.     
  36.     /**
  37.      * Returns the remote object associated with the specified name in the 
  38.      * registry.
  39.      *
  40.      * @exception RemoteException If remote operation failed.
  41.      * @exception NotBoundException if there is no object with this name in the
  42.      *              registry.
  43.      * @exception AccessException If this operation is not permitted.
  44.      */
  45.     public Remote lookup(String name)
  46.     throws RemoteException, NotBoundException, AccessException;
  47.  
  48.     /**
  49.      * Binds the name to the specified remote object.
  50.      * @exception RemoteException If remote operation failed.
  51.      * @exception AlreadyBoundException If name is already bound.
  52.      * @exception AccessException If this operation is not permitted.
  53.      */
  54.     public void bind(String name, Remote obj)
  55.     throws RemoteException, AlreadyBoundException, AccessException;
  56.     
  57.     /**
  58.      * Unbind the name.
  59.      * @exception RemoteException If remote operation failed.
  60.      * @exception NotBoundException if there is no object with this name in the
  61.      *              registry.
  62.      * @exception AccessException If this operation is not permitted.
  63.      */
  64.     public void unbind(String name)
  65.     throws RemoteException, NotBoundException, AccessException;
  66.  
  67.  
  68.     /** 
  69.      * Rebind the name to a new object, replacing any existing binding.
  70.      * @exception RemoteException If remote operation failed.
  71.      * @exception AccessException If this operation is not permitted.
  72.      */
  73.     public void rebind(String name, Remote obj)
  74.     throws RemoteException, AccessException;
  75.  
  76.     /**
  77.      * Returns an array of the names in the registry.
  78.      * @exception RemoteException If remote operation failed.
  79.      * @exception AccessException If this operation is not permitted.
  80.      */
  81.     public String[] list()
  82.     throws RemoteException, AccessException;
  83. }
  84.